<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Insert title here</title>
	</head>
	<body>
	<a4j:form>
		Últimas 10 perguntas:
		<br />
		
		<a4j:repeat id="list" value="#{perguntaBean.lastQuestions}"
			var="item" rows="10" >
			
			<li><h2><h:outputText value="#{item.titulo}"/></h2></li>
			<li>
				<div class="entry">
					<p>
						<h:outputText id="content" value="#{item.descricao}" />
					</p>
				</div>
			</li>
			<li>
			<p class="postmetadata">
				Enviada em<h:outputText value=" #{item.dataEnvio}" /> 
				Autor: <h:outputText value=" #{item.usuario.login}" />|
				<h:commandLink action="#{respostaBean.answer}" value="#{item.quantidadeRespostas} Resposta(s)">
					<f:setPropertyActionListener value="#{item.id}" 
						target="#{respostaBean.idEntity}" />
				</h:commandLink>
				|<br />
				<h:commandLink action="#{respostaBean.answer}" value="Responder">
					<f:setPropertyActionListener value="#{item.id}" 
						target="#{respostaBean.idEntity}" />
				</h:commandLink>
			</p>
			</li>
			
		</a4j:repeat>
	</a4j:form>
	</body>
</ui:composition>